<template>
  <div class="pdf-viewer">
    <iframe
      v-if="pdfUrl"
      :src="pdfUrl"
      width="100%"
      height="800px"
      frameborder="0"
    ></iframe>
  </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const pdfUrl = ref('')

onMounted(() => {
  const id = route.params.id
  // 设置PDF查看URL
  pdfUrl.value = `/api/pdf/view/${id}`
})
</script>

<style scoped>
.pdf-viewer {
  width: 100%;
  padding: 20px;
  background: #f5f5f5;
}
</style> 